/**
 * 
 */
package sourceFiles;

import Exceptions.InvalidChildID;
import Exceptions.InvalidRideId;
import Exceptions.TicketDoesntExist;
import Exceptions.CentralComputerExceptions.ChildAgeDoesntMatch;
import Exceptions.CentralComputerExceptions.ChildDoesntHaveTicket;
import Exceptions.CentralComputerExceptions.ChildHeightDoesntMatch;
import Exceptions.CentralComputerExceptions.ChildIDDoesntExist;
import Exceptions.CentralComputerExceptions.RideIDDoesntExist;
import RideExceptions.ChildAlreadyInRideException;
import RideExceptions.ChildNotInRideException;
import RideExceptions.RideActiveException;
import RideExceptions.RideInactiveException;

/**
 * An Interface representing a simple gate in the park. a gate can open, close,
 * and pass a child through it (after a confirmation sequence)
 * 
 * @author LASO-Team
 * 
 */
public interface IGate {
	/**
	 * opens the gate. Children may enter\ exit the ride.
	 */
	public void openGate();

	/**
	 * closes the gate. Children cannot enter\ exit the ride this way.
	 */
	public void closeGate();

	/**
	 * A method controlling the event of a child passing through the current
	 * gate. notifies the ride upon calling, and if successfully completed,
	 * means the child can pass the gate
	 * 
	 * @param childID
	 *            the ID of the child that wishes to pass through the gate .
	 * @throws RideActiveException
	 *             if the ride is already active and thus the child may not
	 *             enter.
	 * @throws InvalidChildID
	 *             if the child isn't registered to the ride.
	 * @throws ChildAlreadyInRideException
	 *             if the child has already entered through the gate.
	 * @throws InvalidRideId
	 *             if the ride ID is illegal.
	 * @throws ChildIDDoesntExist
	 *             if the child isn't registered to the system.
	 * @throws ChildDoesntHaveTicket
	 *             If the child doesn't have a ticket.
	 * @throws ChildAgeDoesntMatch
	 *             if the child's age isn't compatible.
	 * @throws ChildHeightDoesntMatch
	 *             if the child's height isn't compatible.
	 * @throws ChildIsInAnotherRide
	 *             if the child is already in another ride playing in it.
	 * @throws TicketDoesntExist
	 *             if the child's ticked does'nt exist.
	 * @throws RideIDDoesntExist
	 *             if the ride's ID isn't in the system.
	 * @throws InvalidPersonID
	 */
	public void passThroughGate(Integer childID) throws RideActiveException,
			RideInactiveException, InvalidChildID, ChildAlreadyInRideException,
			ChildNotInRideException, ChildIDDoesntExist, InvalidRideId,
			ChildHeightDoesntMatch, ChildAgeDoesntMatch, ChildDoesntHaveTicket,
			RideIDDoesntExist, TicketDoesntExist;

	/**
	 * Query for the state of the gate
	 * 
	 * @return if the gate is opened or not.
	 */
	public Boolean IsGateOpened();

}
